﻿package net.wangit.adm.group;

import java.util.HashMap;
import java.util.Map;

import net.wangit.adm.role.PrivilegeTreeFactory;
import net.wangit.user.group.UserGroup;
import net.wangit.user.group.UserGroupFactory;


public class GroupPrivilegeTreeFactory extends PrivilegeTreeFactory {

	public GroupPrivilegeTreeFactory() {
	}

	protected String getDomain() {
		return GroupPrivilegeUI.getAndSetDomain();
	}

	protected Map getPrivileges() throws Exception {
		String groupId = GroupPrivilegeUI.getAndSetGroupId();
		UserGroup group = UserGroupFactory.getUserGroup(groupId);
		return ((Map) (group != null ? group.getPrivileges() : new HashMap()));
	}

	protected boolean isDisabled() {
		return true;
	}
}
